package com.feng.common.validation.constraints;

import com.feng.common.validation.validator.PhoneValidator;
import com.feng.common.validation.validator.RoleLevelValidator;
import com.feng.security.config.SecurityConst;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author Feng
 * @since 2022/4/19 21:01
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = RoleLevelValidator.class)
public @interface RoleLevel {
    String message() default "角色等级值应为" + SecurityConst.ROLE_LEVEL_MIN_VALUE + "~" + SecurityConst.ROLE_LEVEL_MAX_VALUE + "间的整数";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
